import { InputNumber } from 'antd'
import { forwardRef } from 'react'

/**
 * 数字输入框
 * @param {import('antd/es/input-number').InputNumberProps} props
 * @returns
 */
const AekInputNumber = (props, ref) => {
  const { style, ...otherProps } = props
  return (
    <InputNumber
      ref={ref}
      {...{
        controls: false,
        min: 0,
        ...otherProps,
        style: { width: '100%', ...style },
      }}
    />
  )
}

export default forwardRef(AekInputNumber)
